<div class="panel panel-default">
  <div class="panel-heading" data-toggle="collapse" data-target="#collapseThree">
    <h4 class="panel-title">
      <a data-toggle="collapse" data-parent="#accordion" href="#collapseThree">
        SMTP Settings
      </a>
    </h4>
  </div>
  <div id="collapseThree" class="panel-collapse collapse">
    <div class="panel-body">
      <%= f.fields_for :email_settings, @campaign.email_settings do |ff| %>
        <div class="row">
          <div class="col-xs-3">
            <p>Pre-populate:</p>
          </div>
          <div class="col-xs-1">
            <span class="glyphicon glyphicon-question-sign" title='Pre-populate SMTP and Port settings for commonly used email providers'></span>
          </div>
          <div class="col-xs-8">
            <select id="smtpPreFill" class="form-control">
              <option>--Select--</option>
              <option value="google">Gmail</option>
              <option value="outlook">Outlook.com</option>
              <option value="godaddy">GoDaddy</option>
              <option value="sendgrid">Sendgrid</option>
            </select>
          </div>
        </div>

        <div class="row top-buffer">
          <div class="col-xs-3">
            <p>SMTP Outbound Server:</p>
          </div>
          <div class="col-xs-1">
            <span class="glyphicon glyphicon-question-sign" title='SMTP server used to relay emails through'></span>
          </div>
          <div class="col-xs-8">
            <%= ff.text_field(:smtp_server_out,
                    placeholder: 'smtp.phishingfrenzy.local',
                    class: 'form-control') %>
          </div>
        </div>

        <div class="row top-buffer">
          <div class="col-xs-3">
            <p>SMTP Domain:</p>
          </div>
          <div class="col-xs-1">
            <span class="glyphicon glyphicon-question-sign" title='Domain of email address'></span>
          </div>
          <div class="col-xs-8">
            <%= ff.text_field(:domain,
                    placeholder: 'phishingfrenzy.local',
                    class: 'form-control') %>
          </div>
        </div>

        <div class="row top-buffer">
          <div class="col-xs-3">
            <p>SMTP Authentication:</p>
          </div>
          <div class="col-xs-1">
            <span class="glyphicon glyphicon-question-sign" title='SMTP Authentication Method'></span>
          </div>
          <div class="col-xs-8">
            <%= ff.select(:authentication, 
                    @campaign.email_settings.authentications.collect { |a| [a, a] },{}, class: 'form-control') %>
          </div>
        </div>

        <div class="row top-buffer">
          <div class="col-xs-3">
            <p>SMTP Username:</p>
          </div>
          <div class="col-xs-1">
            <span class="glyphicon glyphicon-question-sign" title='SMTP username to authenticate sending emails'></span>
          </div>
          <div class="col-xs-8">
            <%= ff.text_field(:smtp_username,
                    placeholder: 'username',
                    class: 'form-control') %>
          </div>
        </div>

        <div class="row top-buffer">
          <div class="col-xs-3">
            <p>SMTP Password:</p>
          </div>
          <div class="col-xs-1">
            <span class="glyphicon glyphicon-question-sign" title='SMTP password to authenticate sending emails'>
            </span>
          </div>
          <div class="col-xs-8">
            <%= ff.password_field(:smtp_password,
                  placeholder: 'password',
                  class: 'form-control') %>
          </div>
        </div>

        <div class="row top-buffer">
          <div class="col-xs-3">
            <p>Openssl Verify Mode:</p>
          </div>
          <div class="col-xs-1">
            <span class="glyphicon glyphicon-question-sign" title='Session verification mode'></span>
          </div>
          <div class="col-xs-8">
            <%= ff.select(:openssl_verify_mode,
                    @campaign.email_settings.openssl_verify_modes.collect { |m| [m, m] },{},
                    {class: 'form-control'}) %>
          </div>
        </div>

        <div class="row top-buffer">
          <div class="col-xs-3">
            <p>Enable Start TLS Automatically?:</p>
          </div>
          <div class="col-xs-1">
            <span class="glyphicon glyphicon-question-sign" title='Enable Start TLS Automatically?'></span>
          </div>
          <div class="col-xs-8">
            <%= ff.check_box(:enable_starttls_auto, class: 'span9') %>
          </div>
        </div>

        <div class="row top-buffer">
          <div class="col-xs-3">
            <p>SMTP Port:</p>
          </div>
          <div class="col-xs-1">
            <span class="glyphicon glyphicon-question-sign" title='SMTP port used to relay emails through'></span>
          </div>
          <div class="col-xs-8">
            <%= ff.text_field(:smtp_port,
                    placeholder: '25',
                    class: 'form-control') %>
          </div>
        </div>
      <% end %>
    </div>
  </div>
</div>
